# -*- coding: utf-8 -*-
N = 5
list1 = [[7,53, 183, 439, 863],
         [497,383, 563 , 79 ,973],
         [287, 63, 343, 169, 583],
         [627 ,343, 773, 959, 943],
         [767, 473, 103, 699, 303]]
def main():
    printm(list1)

##    print retxy(list1,2,2)
##    printm(list1)
##    setxy(list1,0,0)
##    setxy(list1,2,2)
##    setxy(list1,1,3)
##    setxy(list1,4,4)
    setxy(list1,1,2)
    printm(list1)


def retxy(m,x,y):
    return m[x][y]

def setxy(m,x,y):
##    ret = m[x][y]
##    m[x][y] = 0
    for a in range(N):
        if y == a:
            continue
        m[x][a] = 0

    for b in range(N):
        if b == x :
            continue
        m[b][y] = 0


def printm(m):
    for x in xrange(N):
        for y in xrange(N):
            print "%3d" % m[x][y],
        print
    print

if __name__ == '__main__':
    import time
    start = time.time()
    main()
    print('Execution time: {0} seconds'.format(time.time() - start))
